package L01;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

public class T23 {
    public static void main (String[] args) throws InterruptedException {
        BlockingDeque<String> queue=new LinkedBlockingDeque<> ();
        //阻塞队列的两个基本方法   put（）向队列中加入元素   take（）从队列中去元素
        queue.put ("111");
        queue.put ("222");
        queue.put ("333");
        String elem=queue.take ();
        System.out.println (elem);
        elem=queue.take ();
        System.out.println (elem);
        elem=queue.take ();
        System.out.println (elem);
    }
}
